package com.example.studymvvmproject01

import com.example.studymvvmproject01.base.BaseBean
import com.example.studymvvmproject01.bean.HomeProadBean
import com.example.studymvvmproject01.login.LoginBean
import okhttp3.RequestBody
import retrofit2.http.*

interface Api {

    companion object{
//    const val  BASE_URL="https://www.wanandroid.com/"
    const val  BASE_URL="http://172.16.7.3:8066/"
    }
    //体系数据
    @GET("tree/json")
    suspend fun getTree(): MutableList<Unit>

    /**
     * 获取登录token
     * 静态Header
     * @param requestBody body
     * @return
     */
    @Headers("Authorization:Basic dmlkZW9hbmFseXNpczp2aWRlb2FuYWx5c2lz")
    @POST("/safeMobileServer/smc/auth/oauth/token")
    suspend  fun toke(@Body requestBody: RequestBody?):LoginBean

    /**
     * 按单位获取电厂作业数据
     * @param headers 动态header
     * @param siteId  站点Id
     * @return
     */
    @GET("/safeMobileServer/smc/psmgpersonloccur/personCntByType")
    suspend fun workIndex(
        @Query("siteId") siteId: Int,
    ):HomeProadBean

}